package net.wofly.sale.order.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.wofly.sale.commodity.domain.Commodity;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 赠品
 * <ul>
 * <li>根据活动类型，如果活动中有赠品，保存赠品数量</li>
 * <li></li>
 * </ul>
 *
 * @author lign
 * @version 1.0
 * @created 26-11月-2017 11:32:45
 */
@Data
@Entity
@Table(name = "sale_order_gift")
@ApiModel(description = "赠品")
public class Gift {
    @Id
    private String giftID;
    @ApiModelProperty(value = "活动ID")
    private String activityID;
    @ApiModelProperty(value = "活动赠品ID")
    private String activityGiftID;
    //@ApiModelProperty(value = "渠道商品ID")
    //private String commodityChannelID;
    @ApiModelProperty(value = "终端商品ID")
    private String commodityTerminalID;
    private Long modifyDate;
    @ApiModelProperty(value = "数量")
    private Integer num;
    /**
     * 关联ID
     * <ul>
     * <li>关联是订单时，就是OrderID</li>
     * <li>关联是订单内商品时，就是OrderContentID</li>
     * </ul>
     */
    @ApiModelProperty(value = "关联ID")
    private String relateID;
    /**
     * 关联类型
     * <ul>
     * <li>1:订单  2:订单内商品</li>
     * </ul>
     */
    @ApiModelProperty(value = "关联类型   1:订单  2:订单内商品", allowableValues = "1,2")
    private Integer relateType;
    
    @ApiModelProperty(value = "订单ID")
    private String orderID;
    
    @ApiModelProperty(value = "订单内容ID")
    private String orderContentID;
    
    @ApiModelProperty(value = "赠品的商品信息")
    @Transient
    private Commodity commodity;
    
    @Transient
    private String stockLackMsg;
    
    public Gift() {
    
    }
    @Override
    public void finalize() throws Throwable {
    
    }
}